Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ansible provisionning #217

Merged
merged 8 commits into from Apr 26, 2019
Merged

Ansible provisionning #217

merged 8 commits into from Apr 26, 2019

Conversation

itwars
Copy link
Contributor

@itwars itwars commented Mar 11, 2019

Hi,
My proposal is to add a contrib directory. I've done all Ansible stuff to provision a k3s cluster.
Download task is durty because I can' t get k3s version number, so in case of reprovisionning I remove k3s binary and reload it (need to be fixe in future release : #211 ).
For now I've test it with KVM Debian instances. In few days I'll make it happen for ubuntu and Centos.

I wrote setup process for Alpine Linux in README.

Best regards,
Vincent

@itwars itwars changed the title Ansible provisionning for Debian Ansible provisionning Mar 13, 2019
contrib/ansible/README.md Outdated Show resolved Hide resolved
contrib/ansible/roles/download/tasks/main.yml Outdated Show resolved Hide resolved
Copy link

@mqasimsarfraz mqasimsarfraz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall the playbook looks good but missing ansible tags which is super helpful when running specific tasks.

path: /var/lib/rancher/k3s/server
mode: "{{ p.stat.mode }}"

#- debug: msg="Node TOKEN {{ token }}"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about using ansible tags here with ['never', 'k3s-debug-logs'] this will make sure the task is only executed once you ran the playbook with -e k3s-debug-logs=true.

owner: root
group: root
mode: 755
when: ( ansible_facts.userspace_architecture == "x86_64" )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it can be done by constructing a dictionary of values and combine all these tasks into one:

binary_map = {
"x86_64": "k3s"
"arm_64": "k3s-arm64"
...
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know how to make it work could you pls help me and perhaps make a PR on my repo: https://github.com/itwars/k3s-ansible ?

group: root
mode: 0755

- name: Enable and check K3s service
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use handler here instead of restarting every time

@liyimeng
Copy link
Contributor

liyimeng commented Apr 9, 2019

We already have a simple system like this, why bother with ansible?

Copy link
Contributor

@galal-hussein galal-hussein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@galal-hussein galal-hussein merged commit 39e2e45 into k3s-io:master Apr 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants